<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM action="./manage_operators.php" method=POST name=operator_manager id=operator_manager>
<B>This form allows you to change the name of staff operators in the system.</B><BR><BR>
<?php
error_reporting('IGNORE_REPEATED_ERRORS');
$current_name = $_POST["current_name"];
$updated_name = $_POST["updated_name"];


mysql_connect("localhost", "root", "") or
    die("Could not connect: " . mysql_error());
mysql_select_db("QA");

if(strlen($updated_name)>0){
	mysql_query("update QA.Caller SET Staff_Operator=\"".$updated_name."\" where Staff_Operator=\"".$current_name."\"");
	echo "<I>Updated ".$current_name." to ".$updated_name.".</I><BR><BR>";
}


$result = mysql_query("select Distinct Staff_Operator from Caller");

echo "Current Names (Select one to update)<BR>";
echo "<SELECT name=current_name id=current_name>";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
	echo "<OPTION value=\"".$row[0]."\">".$row[0]."</OPTION>";
}
echo "</SELECT>";


mysql_free_result($result);

?>
<BR>
Enter the change here: 
<INPUT type=Text name=updated_name id=updated_name></INPUT>
<BR>
<INPUT type=SUBMIT name=SUBMIT />
</FORM>
<BODY>
</HTML>